import {requests} from "@/api/request";

export const reqGetFileList=()=>requests({
    url:'/file/list',
})
export const reqUploadFile=(data:any)=>requests({
    url:'/file/upload2/article',
    data:data,
    method:"post",
    contentType:false,
    processData:false,//这个很有必要，不然不行
    dataType:"json",
    mimeType:"multipart/form-data",
})

export const reqGetFileListByToken=()=>requests({
    url:'/file?source=FILE',
    method:"get",
})


export const reqDeleteFile = (fileId:string,source:string)=>requests({
    url:'file',
    params:{
        fileId,source
    },
    method:"delete",
})

export const reqGetDownload=(data:any)=>requests({
    url:'/file/download',
    params:data,
})